﻿using Demo.Api.Models;
using KmFlow.AutoEngines;

namespace Demo.Api.FlowEngines
{
    /// <summary>
    /// 事项自动流程引擎
    /// </summary>
    public class AffairAutoEngineContext : AutoEngineContext
    {
        private readonly Affair _data;

        public AffairAutoEngineContext(Affair data)
        {
            _data = data;
        }

        public override IRuleValidator GetValidator(long ruleId)
        {
            return new RuleValidator1(_data);
        }
    }

    public class RuleValidator1 : IRuleValidator
    {
        private readonly Affair _data;

        public RuleValidator1(Affair data)
        {
            _data = data;
        }

        public bool Validate()
        {
            return true;
        }

        public string GetLineCode()
        {
            return string.Empty;
        }
    }
}